﻿<!DOCTYPE html>
<html>
<head>
    <title>作废卡管理</title>
    <script src="/js/header.js"></script>
    <script src="/lib/date/wdatepicker.js"></script>
</head>
<body>
    <div class="data-wrap case" id="container">
        <div class="data-tool clearfix">
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">银行名称：</label>
                        <input class="form-control" name="bankName" type="text" />
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">银行卡号：</label>
                        <input class="form-control" name="cardNumber" type="text" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">用戶名：</label>
                        <input class="form-control" name="cardName" type="text" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">作废时间：</label>
                        <input id="d421" class="Wdate wd150" name="startTime" type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" />
                        --<input id="d422" class="Wdate wd150 m5_l" name="endTime" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'d421\')}'})" />
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
        <div class="paging">
        </div>

    </div>
    <script type="text/x-dot-template" id="templatePager">
        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l wd125">卡商代号</th>
                                <th class="t_l wd125">银行名称</th>
                                <th class="t_l wd125">用户名</th>
                                <th class="t_l wd125">银行卡号</th>
                                <th class="t_l wd125">副卡号</th>
                                <th class="wd75">类型</th>
                                <th class="wd75">原始类型</th>
                                <th class="wd100">使用状态</th>
                                <th class="wd100">启用状态</th>
                                <th class="t_l wd100">建立人员</th>
                                <th class="wd150">建立时间</th>
                                <th class="t_l wd200">备注</th>
                                <th class="t_c wd150">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it.tData && it.tData.length>0}}
                            {{~it.tData :item:index}}
                            <tr>
                                <td class="t_l wd125">{{= item.cmCode==null?"":item.cmCode }}</td>
                                <td class="t_l wd125">{{= item.bankName }}</td>
                                <td class="t_l wd125"><b>{{= item.cardName }}</b></td>
                                <td class="t_l wd125">{{= item.cardNumber }}</td>
                                <td class="t_l wd125">{{= item.secCardNumber }}</td>
                                <td class="wd75">{{= FlashPay.Util.GetCardTypeValue(item.cardType) }}</td>
                                <td class="wd75">{{= FlashPay.Util.GetCardTypeValue(item.afterCardType) }}</td>
                                <td class="wd100">{{= FlashPay.Util.GetCardStatusValue(item.usingStatus) }}</td>
                                <td class="wd100">{{= FlashPay.Util.GetSpareCardEnableStatusValue(item.enableStatus) }}</td>
                                <td class="t_l wd100">{{= item.createName }}</td>
                                <td class="wd150">{{= item.createDate }}</td>
                                <td class="t_l wd200">{{? item.remark==null }}{{?? }}{{= item.remark }}{{? }}</td>
                                <td class="t_c wd150">
                                    <button type="button" class="btn btn-default btn-xs"
                                            data-href="/view/bankcard/obsoletecardedit.html?id={{= item.bcid}}&companyId={{=item.companyId}}&type=0"
                                            data-title="查看卡资料 - {{= item.cardName}}" data-width="460" data-height="650"
                                            onclick="return dialogOpen(this);">
                                        <span class="glyphicon glyphicon-edit"></span> 查看卡资料
                                    </button>

                                    <a class="btn btn-warning btn-xs" data-confirm=' "{{= item.cardName }}" <br>确定要<span class="orange">还原</span>该银行卡？' data-href="/Bank/Restitute/{{= item.bcid}}">还原</a>
                                </td>
                            </tr>
                            {{~}}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="13">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>

    <script type="text/javascript">
        $(function () {
            FlashPay.UI.DataAutoHeight();
            doSearch();
            setTime();
            $("#btnSearch").click(function () {
                FlashPay.UI.DoSearch();
            });
        });

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });

        function doSearch() {
            FlashPay.UI.Pager(".paging", { templateId: "templatePager", pageSize: 15, ajax: { url: '/Bank/GetObsoleteBankCard' } });
        }

        function setTime() {
            let startTime = FlashPay.Util.GetDateStr(-1);
            $("input[name='startTime']").val(startTime);
            let endTime = FlashPay.Util.GetDateStr(0);
            $("input[name='endTime']").val(endTime);
        }

        function dialogOpen(obj) {
            var modal = $(obj);
            $('#buttons').hide();
            FlashPay.UI.DialogOpen(modal.data("href"), {
                title: modal.data("title"),
                width: modal.data("width"),
                height: modal.data("height"),
                init: function () {
                    this.button(
                        {
                            name: '关闭'
                        }
                    );
                },
            });
        }
    </script>
</body>
</html>